
# https://stackoverflow.com/questions/7184793/how-to-download-a-crx-file-from-the-chrome-web-store-for-a-given-id
# acceptformat from extension(Chrome extension source viewer)

if [ $# -lt 1 ]; then
	echo "Usage: $0 extensionsid savefile"
	exit
fi

PRODVERSION=73.0.3683.86
EXTENSIONID=$1
SAVEFILE=$1.crx
[ $# -gt 1 ] && SAVEFILE=$2

#FMT=crx2,crx3
FMT=crx3

tsocks wget "https://clients2.google.com/service/update2/crx?response=redirect&prodversion=$PRODVERSION&acceptformat=$FMT&x=id%3D$EXTENSIONID%26uc" -O $SAVEFILE

